home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 8 / Night Owl CD-ROM (NOPV8) (Night Owl Publisher) (1993).ISO / 034a / aecur101.arj / CONTRIB / CURSES / SRC / KBGETC.C < prev    next >
C/C++ Source or Header  |  1990-03-08  |  602b  |  34 lines

  1. /*----------------------------------------------------------------------
  2.  * 
  3.  *  kbgetc.c 
  4.  *
  5.  *  copyright (c) 1987,88,89,90 J. Alan Eldridge
  6.  *
  7.  *  this is the non-tasking keyboard handler for Curses
  8.  *
  9.  *----------------------------------------------------------------------
  10.  */
  11.  
  12. #include "curses.h"
  13.  
  14. /*
  15.     kbgetc()
  16.     
  17.     get next character available from keyboard
  18.     
  19.     if key is ctl-backslash, cleanup and exit (panic)
  20. */
  21.       
  22. int
  23. kbgetc()
  24. {
  25.     int c = _kb_getc();
  26.  
  27.     if (c == K_CTL_BKSLASH) {
  28.         endwin();
  29.         exit(1);
  30.     }
  31.  
  32.     return c;
  33. }
  34.